package com.eee.xiang.disruptor.consumer;

import com.eee.xiang.disruptor.event.Trade;
import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.WorkHandler;
import lombok.extern.slf4j.Slf4j;

/**
 * @author eee_xiang
 * @Date 2020/5/22
 * @description
 */
@Slf4j
public class TradeConsumer implements EventHandler<Trade>, WorkHandler<Trade> {

    @Override
    public void onEvent(Trade event, long sequence, boolean endOfBatch) throws Exception {
//        log.info("current sequece is {} and endOfBatch is {}", sequence, endOfBatch);
        log.info("consume EventHandler: {}" ,event.getName());
//        onEvent(event);
    }

    @Override
    public void onEvent(Trade event) throws Exception {
        log.info("consume WorkHandler: {}" ,event.getName());
    }
}
